package designpatterns.strategy;

public abstract class BaseAlgorithmStrategy {
    public abstract int execute(int a, int b);

    //加法操作策略
    static class ExecuteAdd extends BaseAlgorithmStrategy {
        @Override
        public int execute(int a, int b) {
            return a + b;
        }
    }

    //加法操作策略
    static class ExecuteSubtract extends BaseAlgorithmStrategy {
        @Override
        public int execute(int a, int b) {
            return a - b;
        }
    }
}


